package com.itfly.service;

import com.itfly.entity.EventCategories;
import com.itfly.entity.EventManagement;
import com.itfly.entity.Users;
import com.itfly.mapper.EventCategoriesMapper;
import com.itfly.mapper.UsersMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {
    @Autowired
    private UsersMapper usersMapper;

    //查询所
    public List<Users> findAllUserInfo(Integer userId) {
        return usersMapper.selectUsersInfo(userId);
    }


    public Users findByUserName(String username) {
        return usersMapper.selectUsersByUsername(username);
    }
    public List<Users> findAll() {
        List<Users> users = usersMapper.selectUsers();
        return users;
    }

    //注册
    public void register(Users user) {
        usersMapper.insertSelective(user);
    }

    public List<Users> selectByLike(Users users) {
        return usersMapper.selectByLike(users);
    }
}
